/* ************************************************************************
> File Name:     5.c
> Author:        zhfu
> mail:          3346897597@qq.com
> Created Time:  2022年04月29日 星期五 10时58分31秒
> Description:   
 ************************************************************************/
#include<stdio.h>
#include<stdlib.h>

int main(int argc, char *argv[])
{
    char *src = argv[1];
    char *dest = argv[2];

    FILE *f1, *f2;

    if (!(f1 = fopen(src, "r"))){
        fputs("open file ", stderr);
        perror(src);
        exit(1);
    }
    
    if (!(f2 = fopen(dest, "w"))){
        fputs("open file ", stderr);
        perror(dest);
        exit(1);
    }

    char ch;

    while ((ch = fgetc(f1)) != EOF){
        fputc(ch, f2);
    }

    fclose(f1);
    fclose(f2);

    return 0;
}
